
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>netty · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="bian-ma-wen-ti.html" />
    
    
    <link rel="prev" href="springboot/springboot-mongoduo-shu-ju-yuan-pei-zhi.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../code-template.html">
            
                <a href="../code-template.html">
            
                    
                    code-template
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../code-template/excelshang-chuan-xia-zai.html">
            
                <a href="../code-template/excelshang-chuan-xia-zai.html">
            
                    
                    excel动态生成
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../code-template/springbootxia-zai-wen-jian.html">
            
                <a href="../code-template/springbootxia-zai-wen-jian.html">
            
                    
                    springboot下载文件
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../javaji-chu.html">
            
                <a href="../javaji-chu.html">
            
                    
                    java基础
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="javaxian-cheng-chi.html">
            
                <a href="javaxian-cheng-chi.html">
            
                    
                    多线程
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1.1" data-path="javaxian-cheng-chi/xian-cheng-zhuang-tai-ji-zhuan-hua.html">
            
                <a href="javaxian-cheng-chi/xian-cheng-zhuang-tai-ji-zhuan-hua.html">
            
                    
                    线程状态及转化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.2" data-path="javaxian-cheng-chi/javaxian-cheng-chi.html">
            
                <a href="javaxian-cheng-chi/javaxian-cheng-chi.html">
            
                    
                    java线程池
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="wen-ti-pai-cha.html">
            
                <a href="wen-ti-pai-cha.html">
            
                    
                    问题排查
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.2.1" data-path="jstack.html">
            
                <a href="jstack.html">
            
                    
                    jstack
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="springboot.html">
            
                <a href="springboot.html">
            
                    
                    springboot
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.3.1" data-path="springboot/springboot-tian-jia-es-ji-qun.html">
            
                <a href="springboot/springboot-tian-jia-es-ji-qun.html">
            
                    
                    springboot 添加es集群
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.2" data-path="springboot/springboot-mongoduo-shu-ju-yuan-pei-zhi.html">
            
                <a href="springboot/springboot-mongoduo-shu-ju-yuan-pei-zhi.html">
            
                    
                    springboot mongo多数据源配置
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter active" data-level="1.3.4" data-path="netty.html">
            
                <a href="netty.html">
            
                    
                    netty
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="bian-ma-wen-ti.html">
            
                <a href="bian-ma-wen-ti.html">
            
                    
                    编码问题
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.5.1" data-path="bian-ma-wen-ti/ru-he-li-jie-string-getbytes-fang-fa.html">
            
                <a href="bian-ma-wen-ti/ru-he-li-jie-string-getbytes-fang-fa.html">
            
                    
                    如何理解 `String.getBytes` 方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5.2" >
            
                <span>
            
                    
                    编码和编码格式
            
                </span>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../she-ji-mo-shi.html">
            
                <a href="../she-ji-mo-shi.html">
            
                    
                    设计模式
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../she-ji-mo-shi/mo-ban-fang-fa.html">
            
                <a href="../she-ji-mo-shi/mo-ban-fang-fa.html">
            
                    
                    模板方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../she-ji-mo-shi/zhuang-shi-mo-shi.html">
            
                <a href="../she-ji-mo-shi/zhuang-shi-mo-shi.html">
            
                    
                    装饰模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../she-ji-mo-shi/shi-pei-qi-mo-shi.html">
            
                <a href="../she-ji-mo-shi/shi-pei-qi-mo-shi.html">
            
                    
                    适配器模式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../linux.html">
            
                <a href="../linux.html">
            
                    
                    linux
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../linux/comm.html">
            
                <a href="../linux/comm.html">
            
                    
                    常用命令 comm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../linux/awk.html">
            
                <a href="../linux/awk.html">
            
                    
                    常用命令 awk
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../linux/cut.html">
            
                <a href="../linux/cut.html">
            
                    
                    常用命令 cut
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../linux/sed.html">
            
                <a href="../linux/sed.html">
            
                    
                    常用命令 sed
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="../linux/tr.html">
            
                <a href="../linux/tr.html">
            
                    
                    常用命令 tr
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6" data-path="../linux/sort.html">
            
                <a href="../linux/sort.html">
            
                    
                    常用命令 sort
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.7" data-path="../linux/find.html">
            
                <a href="../linux/find.html">
            
                    
                    常用命令 find
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.8" data-path="../linux/zip.html">
            
                <a href="../linux/zip.html">
            
                    
                    常用命令 zip
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.9" data-path="../linux/chang-yong-ming-ling-shuf.html">
            
                <a href="../linux/chang-yong-ming-ling-shuf.html">
            
                    
                    常用命令 shuf
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.10" data-path="../linux/chang-yong-ming-ling-grep.html">
            
                <a href="../linux/chang-yong-ming-ling-grep.html">
            
                    
                    常用命令 grep
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.11" data-path="../linux/centos7-bootkong-jian-bu-zu-wen-ti.html">
            
                <a href="../linux/centos7-bootkong-jian-bu-zu-wen-ti.html">
            
                    
                    centos7 boot空间不足问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.12" data-path="../linux/vim-ru-men.html">
            
                <a href="../linux/vim-ru-men.html">
            
                    
                    vim 入门
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../sou-suo.html">
            
                <a href="../sou-suo.html">
            
                    
                    搜索
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../sou-suo/elasticsearch.html">
            
                <a href="../sou-suo/elasticsearch.html">
            
                    
                    elasticsearch
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1.1" data-path="../sou-suo/elasticsearch/elasticsearchzhong-wen-fen-ci-cha-xun-wen-ti.html">
            
                <a href="../sou-suo/elasticsearch/elasticsearchzhong-wen-fen-ci-cha-xun-wen-ti.html">
            
                    
                    elasticsearch中文分词查询问题
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../cun-chu.html">
            
                <a href="../cun-chu.html">
            
                    
                    存储
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../cun-chu/mysqlxiu-gai-mo-ren-shi-qu.html">
            
                <a href="../cun-chu/mysqlxiu-gai-mo-ren-shi-qu.html">
            
                    
                    mysql修改默认时区
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../cun-chu/mysqlchang-yong-sql.html">
            
                <a href="../cun-chu/mysqlchang-yong-sql.html">
            
                    
                    mysql常用sql
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../cun-chu/dockerbu-shu-mysql-shi-she-zhi-huan-jing-bian-liang.html">
            
                <a href="../cun-chu/dockerbu-shu-mysql-shi-she-zhi-huan-jing-bian-liang.html">
            
                    
                    docker部署mysql时设置环境变量
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../docker.html">
            
                <a href="../docker.html">
            
                    
                    docker
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../docker/jing-xiang-jia-su.html">
            
                <a href="../docker/jing-xiang-jia-su.html">
            
                    
                    镜像加速
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../suan-fa.html">
            
                <a href="../suan-fa.html">
            
                    
                    算法相关
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../suan-fa/ru-he-ji-suan-shi-jian-fu-za-du.html">
            
                <a href="../suan-fa/ru-he-ji-suan-shi-jian-fu-za-du.html">
            
                    
                    如何计算时间复杂度
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../netty.html">
            
                <a href="../netty.html">
            
                    
                    netty
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../netty/xu-lie-hua.html">
            
                <a href="../netty/xu-lie-hua.html">
            
                    
                    序列化
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >netty</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="select-vs-epoll">select vs epoll</h2>
<p>&#x5728;linux&#x7F51;&#x7EDC;&#x7F16;&#x7A0B;&#x4E2D;&#xFF0C;&#x652F;&#x6301;I/O &#x591A;&#x8DEF;&#x590D;&#x7528;&#x7684;&#x7CFB;&#x7EDF;&#x8C03;&#x7528;&#x6709; select&#x3001;pselect&#x3001;pool&#x3001;epoll &#x8FD9;&#x51E0;&#x4E2A;&#x3002; select&#x4E0E;epoll &#x539F;&#x7406;&#x5F88;&#x7C7B;&#x4F3C;&#xFF0C;&#x4F46;&#x662F;epoll&#x662F;&#x5728;select&#x4E0A;&#x9762;&#x505A;&#x4E86;&#x5F88;&#x591A;&#x6539;&#x8FDB;&#x3002;</p>
<h3 id="1-&#x652F;&#x6301;&#x4E00;&#x4E2A;&#x8FDB;&#x7A0B;&#x6253;&#x5F00;&#x7684;socket&#x63CF;&#x8FF0;&#x7B26;fd-&#x4E0D;&#x53D7;&#x9650;&#x5236;&#x4EC5;&#x53D7;&#x9650;&#x4E8E;&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x7684;&#x6700;&#x5927;&#x6587;&#x4EF6;&#x53E5;&#x67C4;&#x6570;">1. &#x652F;&#x6301;&#x4E00;&#x4E2A;&#x8FDB;&#x7A0B;&#x6253;&#x5F00;&#x7684;socket&#x63CF;&#x8FF0;&#x7B26;(FD) &#x4E0D;&#x53D7;&#x9650;&#x5236;(&#x4EC5;&#x53D7;&#x9650;&#x4E8E;&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x7684;&#x6700;&#x5927;&#x6587;&#x4EF6;&#x53E5;&#x67C4;&#x6570;)</h3>
<p>select &#x9ED8;&#x8BA4;&#x53EA;&#x652F;&#x6301;1024&#x4E2A;&#xFF0C; epoll&#x5374;&#x80FD;&#x652F;&#x6301;&#x5F88;&#x5927;&#x3002;(1G &#x5185;&#x5B58;&#x5927;&#x7EA6;&#x662F;10&#x4E07;&#x4E2A;&#x53E5;&#x67C4;)</p>
<h3 id="2io-&#x6548;&#x7387;&#x4E0D;&#x4F1A;&#x968F;&#x7740;fd&#x6570;&#x76EE;&#x7684;&#x589E;&#x52A0;&#x800C;&#x7EBF;&#x6027;&#x4E0B;&#x964D;&#x3002;">2.I/O &#x6548;&#x7387;&#x4E0D;&#x4F1A;&#x968F;&#x7740;FD&#x6570;&#x76EE;&#x7684;&#x589E;&#x52A0;&#x800C;&#x7EBF;&#x6027;&#x4E0B;&#x964D;&#x3002;</h3>
<p>epoll&#x53EA;&#x4F1A;&#x626B;&#x63CF;&#x6D3B;&#x8DC3;&#x7684;socket&#xFF0C;&#x4E8C;select&#x4F1A;&#x5168;&#x90E8;&#x626B;&#x63CF;&#x3002;</p>
<h3 id="3-&#x4F7F;&#x7528;mmap&#x52A0;&#x901F;&#x5185;&#x6838;&#x4E0E;&#x7528;&#x6237;&#x7A7A;&#x95F4;&#x7684;&#x6D88;&#x606F;&#x4F20;&#x9012;">3. &#x4F7F;&#x7528;mmap&#x52A0;&#x901F;&#x5185;&#x6838;&#x4E0E;&#x7528;&#x6237;&#x7A7A;&#x95F4;&#x7684;&#x6D88;&#x606F;&#x4F20;&#x9012;</h3>
<h3 id="4-epoll&#x7684;api&#x66F4;&#x52A0;&#x7B80;&#x5355;&#x3002;">4. epoll&#x7684;API&#x66F4;&#x52A0;&#x7B80;&#x5355;&#x3002;</h3>
<h2 id="io&#x901A;&#x4FE1;&#x6A21;&#x578B;">IO&#x901A;&#x4FE1;&#x6A21;&#x578B;</h2>
<ol>
<li>&#x540C;&#x6B65;io (BIO)</li>
</ol>
<p>bio&#x7684;&#x95EE;&#x9898;&#x5728;&#x4E8E; &#x6BCF;&#x5F53;&#x6709;&#x4E00;&#x4E2A;&#x65B0;&#x7684;&#x5BA2;&#x6237;&#x7AEF;&#x8BF7;&#x6C42;&#x63A5;&#x5165;&#x65F6;&#xFF0C;&#x670D;&#x52A1;&#x5668;&#x7AEF;&#x5FC5;&#x987B;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x65B0;&#x7684;&#x7EBF;&#x7A0B;&#x5904;&#x7406;&#x65B0;&#x63A5;&#x5165;&#x7684;&#x5BA2;&#x6237;&#x7AEF;&#x8FDE;&#x63A5;&#xFF0C;&#x4E00;&#x4E2A;&#x7EBF;&#x7A0B;&#x53EA;&#x80FD;&#x5904;&#x7406;&#x4E00;&#x4E2A;&#x5BA2;&#x6237;&#x7AEF;&#x8FDE;&#x63A5;&#x3002; &#x540C;&#x6B65;io&#x7684;&#x95EE;&#x9898;&#x5728;&#x4E8E;: &#x5F53;&#x5BF9;socket&#x7684;&#x8F93;&#x5165;&#x6D41;&#x8FDB;&#x884C;&#x8BFB;&#x53D6;&#x64CD;&#x4F5C;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x5B83;&#x4F1A;&#x4E00;&#x76F4;&#x963B;&#x585E;&#x4E0B;&#x53BB;&#xFF0C;&#x76F4;&#x5230;&#x6709;&#x6570;&#x636E;&#x53EF;&#x8BFB;&#x6216;&#x8005;&#x53D1;&#x751F;&#x5F02;&#x5E38;&#x3002;</p>
<p>&#x8FD9;&#x610F;&#x5473;&#x8005;&#x5F53;&#x5BF9;&#x65B9;&#x53D1;&#x9001;&#x8BF7;&#x6C42;&#x6216;&#x8005;&#x5E94;&#x7B54;&#x6D88;&#x606F;&#x6BD4;&#x8F83;&#x7F13;&#x6162; &#x6216;&#x8005;&#x7F51;&#x7EDC;&#x4F20;&#x8F93;&#x8F83;&#x6162;&#x65F6;&#xFF0C;&#x8BFB;&#x53D6;&#x8F93;&#x5165;&#x6D41;&#x4E00;&#x65B9;&#x7684;&#x901A;&#x4FE1;&#x7EBF;&#x7A0B;&#x5C06;&#x88AB;&#x957F;&#x65F6;&#x95F4;&#x5835;&#x585E;&#xFF0C;&#x5982;&#x679C;&#x5BF9;&#x65B9;&#x8981;60s&#x624D;&#x80FD;&#x591F;&#x5C06;&#x6570;&#x636E;&#x53D1;&#x9001;&#x5B8C;&#x6210;&#xFF0C;&#x8BFB;&#x53D6;&#x4E00;&#x65B9;&#x7684;io&#x7EBF;&#x7A0B;&#x4E5F;&#x5C06;&#x4F1A;&#x88AB;&#x540C;&#x6B65;&#x963B;&#x585E;60s&#xFF0C;&#x5728;&#x6B64;&#x671F;&#x95F4;&#xFF0C;&#x5176;&#x4ED6;&#x63A5;&#x5165;&#x6D88;&#x606F;&#x53EA;&#x80FD;&#x5728;&#x6D88;&#x606F;&#x961F;&#x5217;&#x4E2D;&#x6392;&#x961F;&#x3002;&#x5199;&#x51FA;&#x7684;&#x64CD;&#x4F5C;&#x4E5F;&#x662F;&#x4E00;&#x6837;&#x7684;&#x3002;</p>
<ol>
<li>&#x4F2A;&#x5F02;&#x6B65;IO</li>
</ol>
<p>&#x4F2A;&#x5F02;&#x6B65;IO&#x5728;BIO&#x7684;&#x57FA;&#x7840;&#x4E0A;&#x52A0;&#x5165;&#x4E86;&#x7EBF;&#x7A0B;&#x6C60;&#x7684;&#x5904;&#x7406;&#x903B;&#x8F91;&#xFF0C;&#x907F;&#x514D;&#x4E86;&#x4E3A;&#x6BCF;&#x9694;&#x8BF7;&#x6C42;&#x90FD;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x72EC;&#x7ACB;&#x7684;&#x7EBF;&#x7A0B;&#xFF0C;&#x9020;&#x6210;&#x7EBF;&#x7A0B;&#x8D44;&#x6E90;&#x8017;&#x5C3D;&#x7684;&#x95EE;&#x9898;&#x3002; &#x4F46;&#x662F;&#x7531;&#x4E8E;&#x5B83;&#x5E95;&#x5C42;&#x7684;&#x901A;&#x4FE1;&#x4F9D;&#x7136;&#x91C7;&#x53D6;&#x4E86;&#x540C;&#x6B65;&#x963B;&#x585E;&#x6A21;&#x578B;&#xFF0C;&#x56E0;&#x6B64;&#x65E0;&#x6CD5;&#x4ECE;&#x6839;&#x672C;&#x4E0A;&#x89E3;&#x51B3;&#x95EE;&#x9898;&#x3002;.</p>
<ol>
<li>nio</li>
</ol>
<p>nio&#x91CC;&#x9762;&#x7684; SocketChannel &#x548C; ServerSocketChannel &#x5BF9;&#x5E94;&#x4E86; BIO&#x91CC;&#x9762;&#x7684; Socket&#x548C;ServerSocket</p>
<p>nio&#x5F15;&#x5165;&#x4E86;&#x7F13;&#x51B2;&#x533A;&#x7684;&#x6982;&#x5FF5;(buffer) &#x8FD9;&#x662F;&#x548C;bio&#x7684;&#x4E00;&#x4E2A;&#x91CD;&#x8981;&#x533A;&#x522B;&#x3002; bio&#x5C06;&#x6570;&#x636E;&#x76F4;&#x63A5;&#x8BFB;&#x53D6;&#x5230;&#x6D41;&#xFF0C;&#x800C;nio&#x5219;&#x9762;&#x5411;&#x7F13;&#x5B58;</p>
<p>nio&#x5F15;&#x5165;&#x4E86;&#x901A;&#x9053;&#x7684;&#x6982;&#x5FF5;(channel)  &#x6D41;&#x5F0F;&#x5355;&#x5411;&#x7684;&#xFF0C;&#x800C;&#x901A;&#x9053;&#x662F;&#x53CC;&#x5411;&#x7684;(&#x5168;&#x53CC;&#x5DE5;)</p>
<p>&#x591A;&#x8DEF;&#x590D;&#x7528;&#x5668; selector&#x3002; &#x7B80;&#x5355;&#x6765;&#x8BB2; selector&#x4F1A;&#x4E0D;&#x65AD;&#x5730;&#x8F6E;&#x8BE2;&#x6CE8;&#x518C;&#x5728;&#x5176;&#x4E0A;&#x7684;Channel&#xFF0C;&#x5982;&#x679C;&#x67D0;&#x4E2A;Channel&#x4E0A;&#x9762;&#x53D1;&#x751F;&#x8BFB;&#x6216;&#x8005;&#x5199;&#x65F6;&#x95F4;&#xFF0C;&#x8FD9;&#x4E2A;Channel&#x5C31;&#x5904;&#x4E8E;&#x5C31;&#x7EEA;&#x72B6;&#x6001;&#xFF0C;&#x4F1A;&#x88AB;selector&#x8F6E;&#x8BE2;&#x51FA;&#x6765;&#xFF0C;&#x7136;&#x540E;&#x901A;&#x8FC7;SelectionKey&#x53EF;&#x4EE5;&#x83B7;&#x53D6;&#x5C31;&#x7EEA;Channel&#x7684;&#x96C6;&#x5408;&#xFF0C;&#x8FDB;&#x884C;&#x540E;&#x7EED;&#x7684;IO&#x64CD;&#x4F5C;&#x3002;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="springboot/springboot-mongoduo-shu-ju-yuan-pei-zhi.html" class="navigation navigation-prev " aria-label="Previous page: springboot mongo多数据源配置">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="bian-ma-wen-ti.html" class="navigation navigation-next " aria-label="Next page: 编码问题">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"netty","level":"1.3.4","depth":2,"next":{"title":"编码问题","level":"1.3.5","depth":2,"path":"javaji-chu/bian-ma-wen-ti.md","ref":"javaji-chu/bian-ma-wen-ti.md","articles":[{"title":"如何理解 `String.getBytes` 方法","level":"1.3.5.1","depth":3,"path":"javaji-chu/bian-ma-wen-ti/ru-he-li-jie-string-getbytes-fang-fa.md","ref":"javaji-chu/bian-ma-wen-ti/ru-he-li-jie-string-getbytes-fang-fa.md","articles":[]},{"title":"编码和编码格式","level":"1.3.5.2","depth":3,"ref":"","articles":[]}]},"previous":{"title":"springboot mongo多数据源配置","level":"1.3.3.2","depth":3,"path":"javaji-chu/springboot/springboot-mongoduo-shu-ju-yuan-pei-zhi.md","ref":"javaji-chu/springboot/springboot-mongoduo-shu-ju-yuan-pei-zhi.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"javaji-chu/netty.md","mtime":"2018-11-25T06:09:57.963Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-01-30T06:15:10.391Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

